# Author:lzhan  Date:2020/3/17
# import lxml.html as lx

# lxml 包   html 模块  etree 方法
from lxml.html import etree

# 1. 读取文件  2. 把文件转化为可查找的对象

# xml_books是一个树形的结构，他是树根
xml_books=etree.parse('data/books.xml')

# xpath 寻址
books=xml_books.xpath('book')

print(books)


